<template>
  <div class="positiveInfo">
    <p class="p_tip">居民信息</p>
    <el-form label-width="100px">
      <el-form-item label="姓名：">
        <span>{{form.userName}}</span>
      </el-form-item>
      <el-form-item label="证件类型：">
        <span v-show="form.identifyType==1">身份证</span>
        <span v-show="form.identifyType==2">护照</span>
        <span v-show="form.identifyType==3">港澳通行证</span>
        <span v-show="form.identifyType==4">台胞证</span>
        <span v-show="form.identifyType==5">士官证</span>
        <span v-show="form.identifyType==6">学生证</span>
        <span v-show="form.identifyType==7">其它证件</span>
      </el-form-item>
      <el-form-item label="证件号码：">
        <span>{{form.identifyNo}}</span>
      </el-form-item>
      <el-form-item label="居住地址：">
        <span>{{form.homeName}}</span>
      </el-form-item>
      <el-form-item label="手机号码：">
        <span>{{form.phoneNumber}}</span>
      </el-form-item>
    </el-form>
    <p class="p_tip">密接人员</p>
    <el-table
      header-cell-class-name="header-class"
      :data="form.closeContactsList"
      size="small"
      border>
      <el-table-column
        prop="userName"
        label="姓名"
        show-overflow-tooltip>
      </el-table-column>
      <el-table-column
        prop="phoneNumber"
        label="手机号码"
        show-overflow-tooltip>
      </el-table-column>
      <el-table-column
        prop="detectionResult"
        label="最新核酸结果"
        show-overflow-tooltip>
        <template slot-scope="{row}">
          <span v-if="row.detectionResult==1">阳性</span>
          <span v-if="row.detectionResult==2">阴性</span>
        </template>
      </el-table-column>
    </el-table>
    <p class="p_tip">检测记录</p>
    <el-table
      header-cell-class-name="header-class"
      :data="form.personalDetectionList"
      size="small"
      border>
      <el-table-column
        prop="detectionTime"
        label="检测时间"
        show-overflow-tooltip>
      </el-table-column>
      <el-table-column
        prop="notificationName"
        label="通知名称"
        show-overflow-tooltip>
      </el-table-column>
      <el-table-column
        prop="detectionResult"
        label="检测结果"
        show-overflow-tooltip>
        <template slot-scope="{row}">
          <span v-if="row.detectionResult==1">阳性</span>
          <span v-if="row.detectionResult==2">阴性</span>
        </template>
      </el-table-column>
    </el-table>
    <p class="p_tip">转运记录</p>
    <el-table
      header-cell-class-name="header-class"
      :data="form.personalStatusCommitReqDTOList"
      size="small"
      border>
      <el-table-column
        prop="transportTime"
        label="转运日期"
        show-overflow-tooltip>
      </el-table-column>
      <el-table-column
        prop="transportPlace"
        label="转出地点"
        show-overflow-tooltip>
      </el-table-column>
      <el-table-column
        prop="homeTime"
        label="回家时间"
        show-overflow-tooltip>
      </el-table-column>
      <el-table-column
        prop="remarks"
        label="备注"
        show-overflow-tooltip>
      </el-table-column>
    </el-table>
    <el-row style="text-align: center;line-height: 80px">
      <el-button size="small" type="primary" @click="$router.go(-1)">返 回</el-button>
    </el-row>
  </div>
</template>

<script>
  export default {
    name: "positiveInfo",
    data() {
      return {
        form: {},
        tableData1: [],
        userId: null,
      }
    },
    methods: {
      init() {
        this.$ajax.peng.queryYangPersonalDetails({userId: this.userId}).then(data => {
          this.form = Object.assign({}, data.data)
          console.log(this.form )
        })
      }
    },
    mounted() {
      this.userId = this.$route.query.userId
      this.init()
    },
  }
</script>

<style lang="scss">
  .positiveInfo {
    .el-form {
      display: flex;
      flex-wrap: wrap;
    }

    .el-form-item__content {
      text-overflow: ellipsis;
      overflow: hidden;
      width: 226px;
      margin-right: 30px;
    }

    .el-form-item {
      margin-bottom: 6px;
    }

  }
</style>
